// src/api/models/User.js

import mongoose from 'mongoose';

const userSchema = new mongoose.Schema({
    username: {
        type: String,
        required: true,
        unique: true
    },
    password: {
        type: String,
        required: true
    },
    email: {
        type: String,
        required: false,
        unique: true
    },
    // fullName: String,
    address: {
        street: String,
        city: String,
        state: String,
        zipCode: String,
        country: String
    },
    phoneNumber: String,
    avatar: String, // URL to the profile picture
    dateOfBirth: Date,
    gender: {
        type: String,
        enum: ['male', 'female']
    },
    isActive: {
        type: Boolean,
        default: true
    },
    role: {
        type: String,
        default: 'customer',
        enum: ['customer', 'admin', 'manager']
    },
    createdTime: String,
    updatedTime: String,
    // robot: Robot
    // 添加更多字段根据需求
});

const User = mongoose.model('User', userSchema);

export default User;
